<?php

namespace App\Http\Controllers\Api;

use App\model\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class UserController extends Controller
{
    function login(Request $request){
        $info=$request->all();
        $user=User::where("username",$info["username"])->first();
        if($user!=null&&$user->password==$info["password"]){
            return ["code"=>200,"msg"=>"登陆成功","userinfo"=>$user];
        }
        else

        return ["code"=>401,"登录失败"];
    }
}
